package com.voicechat.firstmet.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @ProjectName: FirstMet
 * @Package: com.voicechat.firstmet.bean
 * @ClassName: VoiceChatIngWSBean
 * @Description: 语音通话长链接接收到的bean
 * @Author: ljp
 * @CreateDate: 2018/11/21 20:10
 * @Version: 1.0
 */
public class VoiceChatIngWSBean implements Parcelable{

    /**
     * code : 2002
     * object : {"avatarUrl":"head/58241542174592183.jpg","birthday":"1990-11-19","calledId":"821ea40e4eb9474eae5b1fb20170f6ec","callingId":"f68b3c28db3c41d795b34268aef3b68a","gender":2,"gold":5,"nickName":"小姐姐","roomId":10002,"type":2,"vType":2}
     */

    private int code;
    private ObjectBean object;

    protected VoiceChatIngWSBean(Parcel in) {
        code = in.readInt();
    }

    public static final Creator<VoiceChatIngWSBean> CREATOR = new Creator<VoiceChatIngWSBean>() {
        @Override
        public VoiceChatIngWSBean createFromParcel(Parcel in) {
            return new VoiceChatIngWSBean(in);
        }

        @Override
        public VoiceChatIngWSBean[] newArray(int size) {
            return new VoiceChatIngWSBean[size];
        }
    };

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public ObjectBean getObject() {
        return object;
    }

    public void setObject(ObjectBean object) {
        this.object = object;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(code);
    }

    public static class ObjectBean implements Parcelable{
        /**
         * avatarUrl : head/58241542174592183.jpg
         * birthday : 1990-11-19
         * calledId : 821ea40e4eb9474eae5b1fb20170f6ec
         * callingId : f68b3c28db3c41d795b34268aef3b68a
         * gender : 2
         * gold : 5
         * nickName : 小姐姐
         * roomId : 10002
         * type : 2
         * vType : 2
         */

        private String avatarUrl;
        private String birthday;
        private String calledId;
        private String callingId;
        private int gender;
        private int gold;
        private String nickName;
        private int roomId;
        private int type;
        private int vType;
        private String voiceId;//语聊id

        private String animationUrl;
        private String giftId;
        private String giftName;
        private int giftNumber;
        private String imgUrl;
        private int send;//0发送成功 1发送失败
        private int sign;//0主叫  1被叫


        protected ObjectBean(Parcel in) {
            avatarUrl = in.readString();
            birthday = in.readString();
            calledId = in.readString();
            callingId = in.readString();
            gender = in.readInt();
            gold = in.readInt();
            nickName = in.readString();
            roomId = in.readInt();
            type = in.readInt();
            vType = in.readInt();
            voiceId = in.readString();
            animationUrl = in.readString();
            giftId = in.readString();
            giftName = in.readString();
            giftNumber = in.readInt();
            imgUrl = in.readString();
            send = in.readInt();
            sign = in.readInt();
        }

        public static final Creator<ObjectBean> CREATOR = new Creator<ObjectBean>() {
            @Override
            public ObjectBean createFromParcel(Parcel in) {
                return new ObjectBean(in);
            }

            @Override
            public ObjectBean[] newArray(int size) {
                return new ObjectBean[size];
            }
        };

        public String getAnimationUrl() {
            return animationUrl;
        }

        public void setAnimationUrl(String animationUrl) {
            this.animationUrl = animationUrl;
        }

        public String getGiftId() {
            return giftId;
        }

        public void setGiftId(String giftId) {
            this.giftId = giftId;
        }

        public String getGiftName() {
            return giftName;
        }

        public void setGiftName(String giftName) {
            this.giftName = giftName;
        }

        public int getGiftNumber() {
            return giftNumber;
        }

        public void setGiftNumber(int giftNumber) {
            this.giftNumber = giftNumber;
        }

        public String getImgUrl() {
            return imgUrl;
        }

        public void setImgUrl(String imgUrl) {
            this.imgUrl = imgUrl;
        }

        public int getSend() {
            return send;
        }

        public void setSend(int send) {
            this.send = send;
        }

        public int getSign() {
            return sign;
        }

        public void setSign(int sign) {
            this.sign = sign;
        }


        public String getAvatarUrl() {
            return avatarUrl;
        }

        public void setAvatarUrl(String avatarUrl) {
            this.avatarUrl = avatarUrl;
        }

        public String getBirthday() {
            return birthday;
        }

        public void setBirthday(String birthday) {
            this.birthday = birthday;
        }

        public String getCalledId() {
            return calledId;
        }

        public void setCalledId(String calledId) {
            this.calledId = calledId;
        }

        public String getCallingId() {
            return callingId;
        }

        public void setCallingId(String callingId) {
            this.callingId = callingId;
        }

        public int getGender() {
            return gender;
        }

        public void setGender(int gender) {
            this.gender = gender;
        }

        public int getGold() {
            return gold/10;
        }

        public void setGold(int gold) {
            this.gold = gold;
        }

        public String getNickName() {
            return nickName;
        }

        public void setNickName(String nickName) {
            this.nickName = nickName;
        }

        public int getRoomId() {
            return roomId;
        }

        public void setRoomId(int roomId) {
            this.roomId = roomId;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public int getVType() {
            return vType;
        }

        public void setVType(int vType) {
            this.vType = vType;
        }

        public String getVoiceId() {
            return voiceId;
        }

        public void setVoiceId(String voiceId) {
            this.voiceId = voiceId;
        }


        @Override
        public String toString() {
            return "ObjectBean{" +
                    "avatarUrl='" + avatarUrl + '\'' +
                    ", birthday='" + birthday + '\'' +
                    ", calledId='" + calledId + '\'' +
                    ", callingId='" + callingId + '\'' +
                    ", gender=" + gender +
                    ", gold=" + gold +
                    ", nickName='" + nickName + '\'' +
                    ", roomId=" + roomId +
                    ", type=" + type +
                    ", vType=" + vType +
                    ", animationUrl='" + animationUrl + '\'' +
                    ", giftId='" + giftId + '\'' +
                    ", giftName='" + giftName + '\'' +
                    ", giftNumber=" + giftNumber +
                    ", imgUrl='" + imgUrl + '\'' +
                    ", send=" + send +
                    ", sign=" + sign +
                    ", voiceId='" + voiceId + '\'' +
                    '}';
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(avatarUrl);
            dest.writeString(birthday);
            dest.writeString(calledId);
            dest.writeString(callingId);
            dest.writeInt(gender);
            dest.writeInt(gold);
            dest.writeString(nickName);
            dest.writeInt(roomId);
            dest.writeInt(type);
            dest.writeInt(vType);
            dest.writeString(voiceId);
            dest.writeString(animationUrl);
            dest.writeString(giftId);
            dest.writeString(giftName);
            dest.writeInt(giftNumber);
            dest.writeString(imgUrl);
            dest.writeInt(send);
            dest.writeInt(sign);
        }
    }
}
